﻿using System;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition;
using System.IO;
using Caliburn.Micro;
using SuperShell.Common.IoC.Attributes.FilesPane;
using SuperShell.Infrastructure.Panes;
using SuperShell.Utils.FileSystem;

namespace CorePlugin.FileListPane.ViewModels
{
	[FilesPane(Name="CorePlugin.FileListPane", Id = "E15FC98A-6D3F-4F6E-B0FE-E3F132E5E6AB",
		Description = "Represents a list of files, allows navigation and invoking actions on files")]
	[PartCreationPolicy(CreationPolicy.NonShared)]
	public class FileListPaneViewModel : IFilesPane
	{
		public ObservableCollection<FileSystemInfo> FilesList { get; set; }

		public FileListPaneViewModel()
		{
			var path = AppDomain.CurrentDomain.BaseDirectory;
			FilesList = new ObservableCollection<FileSystemInfo>(FileSystemUtils.GetFilesList(path));
		}
	}
}
